"""
时间序列模型预测及评估
"""
from algorithm.simple_ma import sma
from algorithm.exp_smoothing import exp_sm_main
from algorithm.seasonal_index import seasonal_index_main
from algorithm.holt import holt_trend_season
from algorithm.holt_winters import holt_winters_trend_season
from algorithm.arima import arima
from load_data import *


def model_main(series):
    """
    模型入口
    :param series:
    :return:
    """
    # 简单移动平均
    # sma(series=series)

    # 指数平滑
    # exp_sm_main(series=series, alpha=0.3)

    # 季节指数
    # seasonal_index_main(series=series, window=12)

    # holt
    # holt_trend_season(series=series, alpha=0.3)

    # Holt-Winters季节性预测模型
    # holt_winters_trend_season(series=series, window=12)

    # arima
    arima(series=series, order=(1, 0, 0), seasonal_order=(0, 1, 1, 12))


def run():
    """
    函数入口
    :return:
    """
    """
    df_game_currency = load_csv(file='../data/currency.csv',
                                index_name='Time')
    model_main(df=df_game_currency['raw'])
    """
    df = load_excel(file='../data/运输量.xlsx',
                    sheet_name=1,
                    index_name='month')
    model_main(series=df['铁路货运量当期值(万吨)'])


if __name__ == '__main__':
    run()
